<?php
namespace Admin\Controller;
use Think\Controller;
use Admin\Controller\CommonController;

class IndexController extends CommonController {
    /*public function __construct(){
        parent::__construct();
        if(!I('session.admin_uid')){
            $this->error('请登录后访问',U('Public/login'));
        }
    }*/


    public function index(){
        $type=M('SystemChannel')->order('sort ASC')->where(array('spid'=>0,'ishide'=>1))->select();
       foreach($type as $k=>$v){
            $type[$k]['subMenu']=M('SystemChannel')->order('sort ASC')->where(array('spid'=>$v['scid'],'ishide'=>1))->select();            
       }

       //dump($type);

       $this->assign("type",$type);
       $this->display();
    }

    public function home(){
        $serverinfo['GDinfo']=gd_info();
        $serverinfo['phpversion']=PHP_VERSION;
        $serverinfo['safemode']=ini_get("safe_mode") ? "已开启" : "<span style='color:red'>未开启</span>";
        $serverinfo['Register_Globals']=ini_get("Register_Globals") ? "已开启" : "<span style='color:red'>未开启</span>";
        $serverinfo['Magic_Quotes_Gpc']=ini_get("Magic_Quotes_Gpc") ? "已开启" : "<span style='color:red'>未开启</span>";
        $serverinfo['max_upload'] = ini_get("file_uploads") ? ini_get("upload_max_filesize") : " <span style='color:red'>禁止上传</span>";

        $this->assign($serverinfo);
        $this->display();
    }
}